package com.control;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Controller;

import hyl.core.run.MyRun;
import hyl.core.run.MyTimer;
@Controller
/**定时任务
 * 
 * <p>@className:  TaskControl</p> 
 * <p>Description: </p>  
 * @author: zoudyaou qq:37798955
 * @date:   2018年11月20日 下午4:11:07     
 * @copyright: 2018 zoudayou Inc. All rights reserved. 
 * 注意：代码版权归邹达有所有，任何人未经授权不得私自用于商业目的
 */
public class TaskControl {
	MyTimer SE;

	public TaskControl() {
		System.out.println("启用定时任务");
		
		SE = MyTimer.getInstance();

		SE.start(command1, 0,10, TimeUnit.SECONDS);
		SE.start(command5, 0,300, TimeUnit.SECONDS);
		System.out.println("结束定时任务");
		//SE.shutdown();
	}

	private Runnable command1 = new Runnable() {
		@Override
		public void run() {
			System.out.println("10s到了");

		}
	};
	private Runnable command5 = new Runnable() {
		@Override
		public void run() {
			System.out.println("五分钟到了");

		}
	};

}
